import request from '@/utils/request'
// 发布房屋所需要的条件
export const houserequire = () => {
  return request.get('/houses/params')
}
export const gorent = (data) => request({
  method: 'post',
  url: 'user/houses',
  data
})
export const housecondition = (id) => {
  return request.get('/houses/condition', {
    params: {
      id
    }
  })
}
export const imgFn = (data) => request({
  method: 'post',
  url: '/houses/image',
  data,
  headers: {
    'Content-Type': 'multipart/form-data'
  }

})
// 条件查询房屋
export const searchHouse = (id, obj = {}) => {
  return request.get('/houses', {
    params: {
      cityId: id,
      ...obj
    }
  })
}
// 地图
export const searchMap = (id) => {
  return request.get('/area/map', {
    params: {
      id
    }
  })
}
// 房屋具体信息
export const Housedetail = (code) => {
  return request.get(`/houses/${code}`
  )
}
